home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 4 / Mac Giga-ROM 4.0 - 1993.toast / FILES / HYP / C-D / DiskManager2.cpt / DiskManager 2.0 / background_5657.txt < prev    next >
Text File  |  1989-02-26  |  6KB  |  236 lines

  1. -- background: 5657 from stack: in.0
  2. -- bmap block id: 6485
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on newStack
  8.   extend
  9. end newStack
  10.  
  11. on extend
  12.   -- type "extend" into the message box and press return to make
  13.   -- three months worth of new cards.
  14.   if the name of this stack contains "stack ideas"
  15.   then
  16.   answer "Please make a new stack before extending it." with "OK"
  17. else
  18.   answer "Make three months more of new cards?" with "OK" or "Cancel"
  19.   if it is "Cancel" then exit extend
  20.   go to last card of this background
  21.   put getStartDate() into start      --what date to begin on
  22.   if start is "Cancel" then exit extend
  23.   put 60*60*24 into OneDay      --seconds in a day
  24.   repeat with cnt = 1 to (365 div 4)   --three months
  25.     put start into it        --a copy
  26.     convert it to long date
  27.     put it into field "Date"
  28.     add OneDay to start
  29.     doMenu New Card
  30.   end repeat
  31.   convert start to long date     --fix the last card
  32.   put start into field "Date"
  33. end if
  34. end extend
  35.  
  36. function getStartDate
  37. -- end of stack or today, whichever is newer
  38. get field "Date"
  39. if it is empty then put the short date into it
  40. convert it to seconds    --so we can compare
  41. put the short date into today
  42. convert today to seconds
  43. if today < 2587766400 then
  44.   answer "Set the Control Panel to today's date" with "OK"
  45.   return "Cancel"
  46. end if
  47. if it >= today then return it   --calendar already beyond today
  48. convert it to short date
  49. answer "Start from which date?" with it or the short date or "Cancel"
  50. if it is "Cancel" then return it
  51. convert it to seconds
  52. return it
  53. end getStartDate
  54.  
  55. on openBackground
  56.   push recent card
  57. end openBackground
  58.  
  59.  
  60. -- part 11 (button)
  61. -- low flags: 00
  62. -- high flags: 0000
  63. -- rect: left=12 top=262 right=320 bottom=150
  64. -- title width / last selected line: 0
  65. -- icon id / first selected line: 0 / 0
  66. -- text alignment: 1
  67. -- font id: 0
  68. -- text size: 12
  69. -- style flags: 0
  70. -- line height: 16
  71. -- part name: Home
  72. ----- HyperTalk script -----
  73. on mouseUp
  74.   visual effect iris close
  75.   go "Home"
  76. end mouseUp
  77.  
  78.  
  79.  
  80. -- part 70 (button)
  81. -- low flags: 00
  82. -- high flags: 2000
  83. -- rect: left=361 top=180 right=242 bottom=502
  84. -- title width / last selected line: 0
  85. -- icon id / first selected line: 0 / 0
  86. -- text alignment: 1
  87. -- font id: 0
  88. -- text size: 12
  89. -- style flags: 0
  90. -- line height: 16
  91. -- part name: Find
  92. ----- HyperTalk script -----
  93. on mouseUp
  94.   put the userLevel into saveLevel
  95.   set the userLevel to 3
  96.   if the userLevel < 3 then exit mouseUp
  97.   if the freeSize of this stack > 0 then domenu "compact stack"
  98.   set the userLevel to saveLevel
  99.   doMenu "Find..."
  100.  
  101. end mouseUp
  102.  
  103.  
  104.  
  105. -- part 75 (button)
  106. -- low flags: 00
  107. -- high flags: 0000
  108. -- rect: left=359 top=256 right=321 bottom=505
  109. -- title width / last selected line: 0
  110. -- icon id / first selected line: 22308 / 22308
  111. -- text alignment: 1
  112. -- font id: 0
  113. -- text size: 12
  114. -- style flags: 0
  115. -- line height: 16
  116. -- part name: Go To Card
  117. ----- HyperTalk script -----
  118. on mouseUp
  119.   put the userLevel into saveLevel
  120.   set the userLevel to 4
  121.   if the userLevel < 4 then exit mouseUp
  122.  
  123.   if the freeSize of this stack > 0 then domenu "compact stack"
  124.  
  125.   domenu "Last"
  126.  
  127.  
  128. end mouseUp
  129.  
  130.  
  131.  
  132. -- part 91 (button)
  133. -- low flags: 00
  134. -- high flags: 0000
  135. -- rect: left=13 top=102 right=165 bottom=152
  136. -- title width / last selected line: 0
  137. -- icon id / first selected line: 0 / 0
  138. -- text alignment: 1
  139. -- font id: 0
  140. -- text size: 12
  141. -- style flags: 0
  142. -- line height: 16
  143. -- part name: Add To Home
  144. ----- HyperTalk script -----
  145. on mouseUp
  146.   put the userLevel into saveLevel
  147.   set the userLevel to 5
  148.   if the userLevel < 5 then exit mouseUp
  149.  
  150.   answer "Install DiskManager button on Home card?" with "OK" or "Cancel"
  151.   if it is "Cancel" then
  152.     exit mouseUp
  153.   end if
  154.   set lockmessages to true
  155.   choose button tool
  156.   click at location of me
  157.   doMenu Copy Button
  158.   go home
  159.   doMenu Paste Button
  160.   set the name of button "add to home" to "DiskManager"
  161.   set loc of button "DiskManager" to 358,250
  162.   play harpsichord "ee c"
  163.   answer "Drag the new button to the desired location"
  164.   wait until the mouse is down
  165.   set hilite of button "DiskManager" to true
  166.   repeat until the mouse is up
  167.     set loc of button "DiskManager" to the mouseLoc
  168.   end repeat
  169.   set hilite of button "DiskManager" to false
  170.   set script of button "DiskManager" to empty
  171.   set script of button "DiskManager" to "on mouseUp" && return && "visual effect iris open" && return && "go to stack DiskManager" && return && "end mouseUp"
  172.   choose browse tool
  173.   go back
  174.   play harpsichord "ee c"
  175.   set lockmessages to false
  176.   set the userLevel to saveLevel
  177. end mouseUp
  178.  
  179.  
  180.  
  181. -- part 92 (button)
  182. -- low flags: 00
  183. -- high flags: 0000
  184. -- rect: left=363 top=105 right=165 bottom=504
  185. -- title width / last selected line: 0
  186. -- icon id / first selected line: 0 / 0
  187. -- text alignment: 1
  188. -- font id: 0
  189. -- text size: 12
  190. -- style flags: 0
  191. -- line height: 16
  192. -- part name: DiskManager Help
  193. ----- HyperTalk script -----
  194. on mouseUp
  195.   go to card id 5334
  196. end mouseUp
  197.  
  198.  
  199.  
  200. -- part 93 (button)
  201. -- low flags: 00
  202. -- high flags: 0000
  203. -- rect: left=11 top=181 right=243 bottom=150
  204. -- title width / last selected line: 0
  205. -- icon id / first selected line: 0 / 0
  206. -- text alignment: 1
  207. -- font id: 0
  208. -- text size: 12
  209. -- style flags: 0
  210. -- line height: 16
  211. -- part name: Label Help
  212. ----- HyperTalk script -----
  213. on mouseUp
  214.   go to card id 10208
  215. end mouseUp
  216.  
  217.  
  218.  
  219. -- part 94 (button)
  220. -- low flags: 00
  221. -- high flags: 0000
  222. -- rect: left=171 top=137 right=287 bottom=340
  223. -- title width / last selected line: 0
  224. -- icon id / first selected line: 0 / 0
  225. -- text alignment: 1
  226. -- font id: 0
  227. -- text size: 12
  228. -- style flags: 0
  229. -- line height: 16
  230. -- part name: New Button
  231. ----- HyperTalk script -----
  232. on mouseUp
  233.   SET THE VISIBLE OF CARD FIELD 1 TO NOT THE VISIBLE OF CARD FIELD 1
  234. end mouseUp
  235.  
  236.